<template>

  <section class="app-main" >
    <!-- <keep-alive>
        <router-view v-if="!route.meta.link" :key="key" />
    </keep-alive> -->
    <router-view v-if="!route.meta.link" :key="key" v-slot="{ Component }">
      <keep-alive>
          <component :is="Component" />
      </keep-alive>
    </router-view>
  </section>
 
  <!-- <div>131321</div> -->
</template>

<script setup>
import { useRoute } from 'vue-router';
import { computed } from "vue";
const route = useRoute();

const key = computed(() => route.path);
// store.dispatch('tagsView/addCachedView', route);
// const cachedViews = computed(() => {
//   return store.state.tagsView.cachedViews;
// });
</script>

<style lang="scss" scoped>
@import '@/assets/styles/variables.module.scss';
.app-main {
  /* 50= navbar  50  */
  min-height: calc(100vh - 95px);
  width: 100%;
  // position: relative;
  overflow: hidden;
}

.fixed-header + .app-main {
  padding-top: 50px;
}

.hasTagsView {
  .app-main {
    /* 84 = navbar + tags-view = 50 + 34 */
    min-height: calc(100vh - 84px);
  }

  .fixed-header + .app-main {
    padding-top: 90px;
    &.no-padding {
      padding-top: 0px !important;
    }
  }
}
</style>

<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
  .fixed-header {
    padding-right: 17px;
  }
}
</style>
